package znet

type Message struct {
	id   uint32 //消息的ID
	len  uint32 //消息的长度
	data []byte //消息的内容
}

func NewMsgPackage(id uint32, data []byte) *Message {
	return &Message{
		id:   id,
		len:  uint32(len(data)),
		data: data,
	}
}

func (m *Message) GetMsgId() uint32 {
	return m.id
}
func (m *Message) GetMsgLen() uint32 {
	return m.len
}
func (m *Message) GetMsgData() []byte {
	return m.data
}

func (m *Message) SetMsgId(id uint32) {
	m.id = id
}
func (m *Message) SetMsgLen(len uint32) {
	m.len = len
}
func (m *Message) SetMsgData(data []byte) {
	m.data = data
}
